package com.yxhl.zoume.core.main.ui;

import android.content.Context;
import android.support.v4.app.FragmentTabHost;
import android.util.AttributeSet;


/**
 * tabhost
 * Created by Xboy on 16/1/12.
 */
public class ZMFragmentTabHost extends FragmentTabHost {

    private String mCurrentTag;

    private String mNoTabChangedTag;

    public ZMFragmentTabHost(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onTabChanged(String tag) {
        try {
            if (tag.equals(mNoTabChangedTag)) {
                setCurrentTabByTag(mCurrentTag);
            } else {
                super.onTabChanged(tag);
                mCurrentTag = tag;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void setNoTabChangedTag(String tag) {
        this.mNoTabChangedTag = tag;
    }
}
